/**
 * Title:       Message.java
 * Copyright:   Copyright (c) 1996-2004 The Agent Factory Working Group. All rights reserved.
 * Licence:     This file is free software; you can redistribute it and/or modify
 *              it under the terms of the GNU Lesser General Public License as published by
 *              the Free Software Foundation; either version 2.1, or (at your option)
 *              any later version.
 *
 *              This file is distributed in the hope that it will be useful,
 *              but WITHOUT ANY WARRANTY; without even the implied warranty of
 *              MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *              GNU Lesser General Public License for more details.
 *
 *              You should have received a copy of the GNU Lesser General Public License
 *              along with Agent Factory; see the file COPYING.  If not, write to
 *              the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 *              Boston, MA 02111-1307, USA.
 */
package com.agentfactory.platform.mts;

import java.util.ArrayList;

import com.agentfactory.platform.core.AgentID;
import com.agentfactory.platform.mts.FIPAHelper;
/**
 * This class implements a standard FIPA ACL Message.  It should be sublclassed
 * for specific implementations of the standard (i.e. string encoding, xml
 * encoding).
 *
 * @author  Rem Collier
 */
public abstract class Message {
    // Performatives
    public static final String ACCEPT_PROPOSAL                  = "accept-proposal";
    public static final String ACTION                           = "action";
    public static final String AGREE                            = "agree";
    public static final String CANCEL                           = "cancel";
    public static final String CALL_FOR_PROPOSAL                = "cfp";
    public static final String CONFIRM                          = "confirm";
    public static final String DISCONFIRM                       = "disconfirm";
    public static final String FAILURE                          = "failure";
    public static final String INFORM                           = "inform";
    public static final String INFORM_IF                        = "inform-if";
    public static final String INFORM_REF                       = "inform-ref";
    public static final String NOT_UNDERSTOOD                   = "not-understood";
    public static final String PROPOGATE                        = "propogate";
    public static final String PROPOSE                          = "propose";
    public static final String PROXY                            = "proxy";
    public static final String QUERY_IF                         = "query-if";
    public static final String QUERY_REF                        = "query-ref";
    public static final String REFUSE                           = "refuse";
    public static final String REJECT_PROPOSAL                  = "reject_proposal";
    public static final String REQUEST                          = "request";
    public static final String REQUEST_WHEN                     = "request-when";
    public static final String REQUEST_WHENEVER                 = "request-whenever";
    public static final String SUBSCRIBE                        = "subscribe";
    
    protected String performative;
    protected AgentID sender;
    protected ArrayList receivers;
    protected String content;
    protected AgentID replyTo;
    protected String replyWith;
    protected String language;
    protected String ontology;
    protected String protocol;
    protected int contentLength;
    protected String conversationId;
    
    /** Getter for property performative.
     * @return Value of property performative.
     */
    public java.lang.String getPerformative() {
        return performative;
    }
    
    /** Setter for property performative.
     * @param performative New value of property performative.
     */
    public void setPerformative(java.lang.String performative) {
        this.performative = performative;
    }
    
    /** Getter for property sender.
     * @return Value of property sender.
     */
    public AgentID getSender() {
        return sender;
    }
    
    /** Setter for property sender.
     * @param sender New value of property sender.
     */
    public void setSender(AgentID sender) {
        this.sender = sender;
    }
    
    /** Getter for property receivers.
     * @return Value of property receivers.
     */
    public ArrayList getReceivers() {
        return receivers;
    }
    
    /** Setter for property receivers.
     * @param receivers New value of property receivers.
     */
    public void setReceivers(ArrayList receivers) {
        this.receivers = receivers;
    }
    
    /** Getter for property content.
     * @return Value of property content.
     */
    public java.lang.String getContent() {
        return content;
    }
    
    /** Setter for property content.
     * @param content New value of property content.
     */
    public void setContent(java.lang.String content) {
        this.content = content;
    }
    
    /** Getter for property replyTo.
     * @return Value of property replyTo.
     */
    public AgentID getReplyTo() {
        return replyTo;
    }
    
    /** Setter for property replyTo.
     * @param replyTo New value of property replyTo.
     */
    public void setReplyTo(AgentID replyTo) {
        this.replyTo = replyTo;
    }
    
    /** Getter for property replyWith.
     * @return Value of property replyWith.
     */
    public java.lang.String getReplyWith() {
        return replyWith;
    }
    
    /** Setter for property replyWith.
     * @param replyWith New value of property replyWith.
     */
    public void setReplyWith(java.lang.String replyWith) {
        this.replyWith = replyWith;
    }
    
    /** Getter for property language.
     * @return Value of property language.
     */
    public java.lang.String getLanguage() {
        return language;
    }
    
    /** Setter for property language.
     * @param language New value of property language.
     */
    public void setLanguage(java.lang.String language) {
        this.language = language;
    }
    
    /** Getter for property ontology.
     * @return Value of property ontology.
     */
    public java.lang.String getOntology() {
        return ontology;
    }
    
    /** Setter for property ontology.
     * @param ontology New value of property ontology.
     */
    public void setOntology(java.lang.String ontology) {
        this.ontology = ontology;
    }
    
    /** Getter for property contentLength.
     * @return Value of property contentLength.
     */
    public int getContentLength() {
        return contentLength;
    }
    
    /** Setter for property contentLength.
     * @param contentLength New value of property contentLength.
     */
    public void setContentLength(int contentLength) {
        this.contentLength = contentLength;
    }
    
    public byte[] toByteArray() {
        return FIPAHelper.toBytes(toString());
    }
    
    public String getAclRepresentation() {
        return "none";
    }
    
    public String getPayloadEncoding() {
        return "none";
    }
    
    public void setProtocol(String _protocol) {
        protocol = _protocol;
    }
    
    public String getProtocol() {
        return protocol;
    }
    
    public String getConversationId() {
        return conversationId;
    }
    
    public void setConversationId( String conversationId ) {
        this.conversationId = conversationId;
    }

}
    
    
